package com.thon.service.user.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thon.dao.user.UserBindDao;
import com.thon.entity.user.UserBind;
import com.thon.service.user.UserBindService;

/**
 * @file UserBindServiceImpl.java
 * @author Zemo
 * @mail zemochen@gmail.com
 * @data 2013年10月16日 上午8:49:07
 * @description: TODO
 */
@Service
@Transactional
public class UserBindServiceImpl implements UserBindService {
	
	@Autowired
	private UserBindDao userBindDao;
	
	@Override
	public void addUserBind(UserBind userBind) {
		
		userBindDao.save(userBind);
		
	}

	@Override
	public void updateUserBind(UserBind userBind) {

	}

	@Override
	public void deleteUserBind(int id) {
		
		userBindDao.delete(id);
	}

	@Override
	public UserBind getUserBind(int id) {
		return null;
	}

	@Override
	public UserBind getBindByToken(String token) {
		return userBindDao.getBind(token);
	}

	@Override
	public UserBind getUserBind(Integer userId, Byte bindType) {

		return userBindDao.getUserBind(userId,bindType);
	}

	@Override
	public List<UserBind> listUserBinds(Integer userId) {
		return userBindDao.listUserBinds(userId);
	}

}
